<!--
Author: Quan Van Sinh
Email: sinhvnb@vietnambiz.com
-->
<?php
if(!checkLoginReturn()){
    if(isset($_POST['submit'])){
        //echo 'login khong thanh cong';die;
        $username = filter($_POST['username']);
        $password = filter($_POST['password']);
        if(login($username, $password)){
            $location = $config['domain'].'/'.$_SESSION['path'];
        }else{
            $location = $config['domain'].'/'.$config ['admin_section'].'/login';
        }
        header("Location: $location");
    }

}else{
    $location = $config['domain'];
    header("Location: $location");
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>BanTinNhaDat-Administration</title>
	<link rel="stylesheet" type="text/css" href="/admin/themes/default/css/login.css" />

</head>

<body>
	<form id="login-form" action="" method="post">
		<fieldset>

			<legend>Log in</legend>

			<label for="login">Username</label>
			<input type="text" id="login" name="username"/>
			<div class="clear"></div>

			<label for="password">Password</label>
			<input type="password" id="password" name="password"/>
			<div class="clear"></div>

			<br />
                        <label for="password"><a href="<?php echo $config['domain'];?>">home page</a></label>
			<input type="submit" style="margin: -20px 0 0 287px;" class="button" name="submit" value="Log in"/>
		</fieldset>
	</form>
</body>

</html>